description "ZooKeeper"

limit nofile 32768 32768

start on runlevel [2345]
stop on [!12345]

respawn
respawn limit 2 5

umask 007

kill timeout 300

script
    # https://superuser.com/questions/213416/running-upstart-jobs-as-unprivileged-users
    exec su -s /bin/sh -c 'exec "$0" "$@" &>>{{ log_dir }}/init-zookeeper.log' zookeeper -- \
      {{zookeeper_dir}}/bin/zkServer.sh start-foreground
end script
